<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCrmUsersTable extends Migration
{
    /**
     * Run the migrations.
     *crm 用户表
     * @return void
     */
    public function up()
    {
        Schema::create('crm_users', function (Blueprint $table) {
            $table->engine = 'MyISAM';
            $table->comment='crm 用户表';
            $table->increments('uid')->comment('自增键');
            $table->string('name',20)->unique('name')->default('')->comment('账号');
            $table->string('password',60)->default('')->comment('密码');
            $table->string('remember_token',100)->nullable()->comment('记住登录密码');
            $table->tinyInteger('power')->unsigned()->default(0)->comment('是否是管理员，1表示是。');
            $table->string('worker_name',20)->index('worker_name')->default('')->comment('员工名字');
            $table->string('number',20)->unsigned()->index('number')->default('')->comment('员工编号');
            $table->tinyInteger('sex')->unsigned()->default(1)->comment('性别,1男，2女');
            $table->date('birthday')->default('0000-00-00')->comment('出生年月');
            $table->string('phone',20)->default('')->comment('座机');
            $table->string('mobile',11)->unsigned()->index('mobile')->default(0)->comment('手机');
            $table->string('weichat',50)->default('')->comment('微信');
            $table->integer('qq')->unsigned()->default(0)->comment('qq');
            $table->string('email',60)->default('')->comment('邮箱');
            $table->string('enounce',200)->default('')->comment('个人宣言');
            $table->string('img',200)->default('')->comment('头像');
            $table->tinyInteger('todelete')->default(0)->comment('0表示正常，1表示删除');
            $table->tinyInteger('referent_uid')->default(0)->comment('销售参考对象');
            $table->tinyInteger('work_role_id')->default(0)->comment('上班时间段分类，默认0，比如：客服适用时间段1，销售适用时间段2');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('crm_users');
    }
}
